<%@ Page Language="c#" Trace="false" Inherits="FredCK.FCKeditorV2.FileBrowser.Uploader" AutoEventWireup="false" %>
<%@ Register Src="config.ascx" TagName="Config" TagPrefix="FCKeditor" %>
<%--
 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
 * Copyright (C) 2003-2010 Frederico Caldeira Knabben
 *
 * == BEGIN LICENSE ==
 *
 * Licensed under the terms of any of the following licenses at your
 * choice:
 *
 *  - GNU General Public License Version 2 or later (the "GPL")
 *    http://www.gnu.org/licenses/gpl.html
 *
 *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
 *    http://www.gnu.org/licenses/lgpl.html
 *
 *  - Mozilla Public License Version 1.1 or later (the "MPL")
 *    http://www.mozilla.org/MPL/MPL-1.1.html
 *
 * == END LICENSE ==
 *
 * This is the Uploader for ASP.NET.
 *
 * The code of this page if included in the FCKeditor.Net package,
 * in the FredCK.FCKeditorV2.dll assemblyfile. So to use it you must
 * include that DLL in your "bin" directory.
 *
 * To download the FCKeditor.Net package, go to our official web site:
 * http://www.fckeditor.net
--%>
<FCKeditor:Config id="Config" runat="server"></FCKeditor:Config>

<script runat="server">

    public override void SaveComplete(string fileUrl, string fileName, int size, string cataType)
    {
        fanli.DAL.fanli_uploadfile dal = new fanli.DAL.fanli_uploadfile();
        fanli.Model.fanli_uploadfile fileModel = new fanli.Model.fanli_uploadfile();
        fanli.Model.fanli_adminUsers logUser = HttpContext.Current.Session["LoginUser"] as fanli.Model.fanli_adminUsers;
        if (logUser != null)
        {
            fileModel.adminID = logUser.id;
        }
        else
        {
            fileModel.adminID = 0;
        }
        fileModel.cata = cataType;
        fileModel.filepath = fileUrl;
        fileModel.filesize = size;
        fileModel.ip = HttpContext.Current.Request.UserHostAddress;
        fileModel.uploadDate = DateTime.Now;
        dal.Add(fileModel);
    }
</script>
